package com.dalei.vdsmanager.management.vds.service;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.dalei.vdsmanager.management.vds.dao.VDSDeviceStatus;
import com.dalei.vdsmanager.management.vds.dao.VDSDeviceStatusDao;

public class VDSDeviceStatusServiceImpl implements VDSDeviceStatusService,
		Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -132255142885774317L;
	
	private VDSDeviceStatusDao vdsDeviceStatusDao;

	public VDSDeviceStatusDao getVdsDeviceStatusDao() {
		return vdsDeviceStatusDao;
	}

	public void setVdsDeviceStatusDao(VDSDeviceStatusDao vdsDeviceStatusDao) {
		this.vdsDeviceStatusDao = vdsDeviceStatusDao;
	}

	@Override
	public List<VDSDeviceStatus> getDeviceStatus() {
		// TODO Auto-generated method stub
		return vdsDeviceStatusDao.findVDSDeviceStatus();
	}

	@Override
	public List<VDSDeviceStatus> getOnlineDeviceStatus() {
		// TODO Auto-generated method stub
		Date now = new Date();
		return vdsDeviceStatusDao.findVDSDeviceStatusByExpiredTime(now, null);
	}

	@Override
	public VDSDeviceStatus getVDSDeviceStatusByDeviceId(int deviceId) {
		// TODO Auto-generated method stub
		return vdsDeviceStatusDao.findVDSDeviceStatusByDeviceId(deviceId);
	}
}
